import request from '@/utils/request'
// eslint-disable-next-line
export function add(goods_id, goods_count) {
  return request({
    url: '/index/shop_cart/add',
    method: 'post',
    data: {
      goods_id,
      goods_count
    }
  })
}
/**
 * 获取用户购物车内的数据
 */
export function buyerList() {
  return request({
    url: '/index/shop_cart/index',
    method: 'GET'
  })
}
/**
 * 获取用户选择的购物车数据
 */
export function selected(selectedId) {
  return request({
    url: '/index/shop_cart/selected',
    method: 'GET',
    params: {
      id: selectedId
    }
  })
}
export function fetchList(query) {
  return request({
    url: '/admin/shop_cart/index',
    method: 'GET',
    params: query
  })
}
export function fetchOne(id) {
  return request({
    url: '/admin/shop_cart/detail',
    method: 'GET',
    params: { id }
  })
}
export function updateOne(data) {
  return request({
    url: '/admin/shop_cart/update',
    method: 'post',
    data
  })
}
export function createOne(data) {
  return request({
    url: '/admin/shop_cart/create',
    method: 'POST',
    data
  })
}
export function deleteOne(id) {
  return request({
    url: '/admin/shop_cart/delete',
    method: 'DELETE',
    params: {
      id: id
    }
  })
}
